package proj2501.main;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import javax.swing.SwingUtilities;

import proj2501.main_frame.MainFrame;
import proj2501.util.UU;

public class Main {
	public static void main(String[] args) {
		System.out.print("Starting program.");
		System.out.println(" (java.version: " + System.getProperty("java.version") + ")");
		UU.printArgs(args);
		printCurrentTime();
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				new MainFrame();
			}
		});
	}
	
	private static void printCurrentTime() {
		
		// Prints current time.
		Date current = new Date();
		DateFormat format = new SimpleDateFormat("yyyy-MM-dd MMMM EEEE HH:mm:ss", Locale.US);
		// Configures representation style.
		format.setTimeZone(TimeZone.getTimeZone("GMT+0"));
		// Sets the time zone to UTC.
		String utc = format.format(current);
		
		// Gets local time.
		DateFormat format2 = new SimpleDateFormat("z: yyyy-MM-dd HH:mm:ss", Locale.US);
		String local = format2.format(current);
		
		System.out.println("Current Time (UTC): " + utc + " (" + local + ")");
	}
}
